<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="Index.xhtml">  
        <ui:define name="content"> 
            <h:body>
                <p:growl id="avisos" showDetail="true"/>
                <h:form id="formEditar">
                    <p:dialog header="Gerar Relatório de todas as Locações" visible="true" closable="false" draggable="false" resizable="false" width="350">
                        <h:panelGrid columns="2" >
                            <h:outputText value="Data Início"/>
                            <p:calendar value="#{locacaoHandler.locacao.locData}" converterMessage="Data início inválida." required="true" requiredMessage="Campo Data início obrigatório">
                                <f:convertDateTime type="date" pattern="dd/MM/yyyy"/>
                            </p:calendar>
                            <h:outputText value="Data Fim"/>
                            <p:calendar value="#{locacaoHandler.locacao.locdataPrevDevolucao}" converterMessage="Data fim inválida." required="true" requiredMessage="Campo Data fim obrigatório">
                                <f:convertDateTime type="date" pattern="dd/MM/yyyy"/>
                            </p:calendar>
                            <p:spacer height="15"/>
                            <p:commandButton onclick="dlgCarregando.show()" value="Gerar Relatório" action="#{locacaoHandler.invocaServletLocacoesData()}" ajax="false" />  
                        </h:panelGrid>
                    </p:dialog>
                </h:form>

                <p:dialog header="Carregando..." widgetVar="dlgCarregando" modal="true"
                          closable="false">
                    <div style="width: 100%; text-align: center;">
                        <p:graphicImage url="resources/loading.gif" />
                    </div>
                </p:dialog>
            </h:body>
        </ui:define>
    </ui:composition>
</html>
